var x: longint = 0;
	 y: longint = 0;

procedure putchar(c: char);
begin
	if c = #13 then
		x := 0
	else if c = #0 then
		exit
	else if c = #10 then
		inc(y)
	else if c = #9 then
		inc(x, 8-(x mod 8))
	else
	begin
		pchar($b8000+2*(x+y*80))^ := c;
		inc(x);
	end;
	
	if x >= 80 then
	begin
		x := 0;
		inc(y);
	end;

	while y >= 25 do
	begin
		move(pchar($b8000+160)^, pchar($b8000)^, 80*24*2);
		fillword(pchar($b8000+24*160)^, 80, $720);
		dec(y);
	end;
end;